<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>v-show</title>
</head>
<body>
    <div id="app">

        <input type="button" value="切换显示状态" @click="changIsShow">
        <input type="button" value="累加年龄" @click="changAge">
         <img v-show="isShow" src="./img/壁纸8.jpg" alt="" style="width: 400px;"><!-- v-show为true则显示 -->
         <img v-show="age>=18" src="./img/壁纸8.jpg" alt="" style="width: 400px;"><!-- 目前age为16,要点击两次，age才会变为18，才满足条件转换为true -->
    </div>
   
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script>
        var app=new Vue({
            el:"#app",
            data:{
                isShow:false,
                age:16
            },
            methods:{
                changIsShow:function(){
                    this.isShow=!this.isShow
                },
                changAge:function(){
                    this.age+=1
                }
            }

        })
    </script>
</body>
</html>